package com.yihaodian.search.query;

import java.util.Map;

import org.apache.lucene.search.TopDocs;

import com.yihaodian.api.search.facet.FacetResult;
import com.yihaodian.index.meta.shard.Shard;

public class QuerySearchResult implements QuerySearchResultProvider{
	private long id;
	private Shard shard;
	private int from;
    private int size;
    private TopDocs topDocs;
    private Map<String, FacetResult> facetResultMap;
	@Override
	public long id() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
	@Override
	public Shard getShard() {
		return shard;
	}
	@Override
	public QuerySearchResult queryResult() {
		return this;
	}
	@Override
	public boolean includeFetch() {
		return false;
	}
	public void setShard(Shard shard) {
		this.shard = shard;
	}
	public int getFrom() {
		return from;
	}
	public void setFrom(int from) {
		this.from = from;
	}
	public int getSize() {
		return size;
	}
	public void setSize(int size) {
		this.size = size;
	}
	public TopDocs getTopDocs() {
		return topDocs;
	}
	public void setTopDocs(TopDocs topDocs) {
		this.topDocs = topDocs;
	}
	public Map<String, FacetResult> getFacetResultMap() {
		return facetResultMap;
	}
	public void setFacetResultMap(Map<String, FacetResult> facetResultMap) {
		this.facetResultMap = facetResultMap;
	}
	@Override
	public String toString() {
		return "QuerySearchResult [id=" + id + ", shardTarget=" +  shard
				+ ", from=" + from + ", size=" + size + ", topDocs=" + topDocs
				+ "]";
	}
    
}
